// $menuBg:#F1F6FB;
// $menuHover:#DBE2F0;
// $subMenuActiveText:#f4f4f5;
// $subMenuBg:#30426a;
// $subMenuHover:#2b3854;
// $sideBarWidth: 150px;

@import './variables.scss';
@import './variables-theme.scss';
@import './mixin-theme.scss';

#app {

  .main-container {
    height: calc(100vh - 50px);
    transition: margin-left .28s;
    position: relative;
  }

  .topNavTags{
    position: fixed;
    width: calc(100% - 136px);
    z-index: 99;
  }

  .layout-footer {
    height: 50px;
    line-height: 50px;
    text-align: center;
    font-size: 12px;
    color: #999999;
    border-top: 1px solid #e6dde9;
    position: fixed;
    bottom: 0;
    width: calc(100% - 136px);
    background-color: white;
    z-index: 4;
  }

  .sidebar-container {
    transition: width 0.28s;
    width: $sideBarWidth !important;
    @include bg-color(menuBg);
    height: 100%;
    font-size: 0;
    z-index: 1001;
    overflow: hidden;

    // reset element-ui css
    .horizontal-collapse-transition {
      transition: 0s width ease-in-out, 0s padding-left ease-in-out, 0s padding-right ease-in-out;
    }

    .scrollbar-wrapper {
      overflow-x: hidden !important;
    }

    .el-scrollbar__bar.is-vertical {
      right: 0;
    }

    .scrollbar {
      height: calc(100% - 50px);
      overflow-y: auto;
    }

    &.has-logo {
      .scrollbar {
        height: calc(100% - 100px);
        &.default-scrollbar{
          height: calc(100% - 50px);
        }
      }
    }

    .is-horizontal {
      display: none;
    }

    a {
      display: inline-block;
      width: 100%;
      overflow: hidden;
    }

    .svg-icon {
      margin-right: 5px;
      fill: currentColor;
      font-size: 16px;
      vertical-align: middle;
    }

    .el-menu {
      border: none;
      height: 100%;
      width: 100% !important;
    }

    .el-menu {
      @include bg-color(menuBg);
    }
    .el-menu-item,.el-submenu__title {
      @include text-color(menuText);
      i {
        @include text-color(menuText);
      }
    }
    // menu hover
    .submenu-title-noDropdown,
    .el-submenu__title {
      &:hover {
        @include bg-color(menuHover);
      }
    }

    .menu-wrapper {
      & > .is-active {
        .el-submenu__title {
          @include text-color(activeText);
        }
      }
      .el-menu-item {
        border-left: 2px solid transparent;
        &.is-active {
          border-left-width: 2px;
          border-left-style: solid;
          @include border-left-color(activeBorderLeft);
          @include bg-color(menuActiveBg);
          @include text-color(activeText);

        }
        &:focus {
          @include bg-color(subHover);
        }
      }
    }

    & .nest-menu .el-submenu>.el-submenu__title,
    & .el-submenu .el-menu-item {
      min-width: $sideBarWidth !important;
      @include bg-color(subBg);

      &:hover {
        @include bg-color(subHover);
      }
    }

  }

  .hideSidebar {
    .sidebar-container {
      width: 54px !important;
    }

    .main-container {

    }

    .topNavTags{
      width: calc(100% - 54px);
    }

    .layout-footer {
      width: calc(100% - 54px);
    }

    .submenu-title-noDropdown {
      padding: 0 !important;
      position: relative;

      .el-tooltip {
        padding: 0 !important;

        .svg-icon {
          margin-left: 20px;
        }
      }
    }
    .sidebar-container {
      .el-submenu {
        overflow: hidden;

        & > .el-submenu__title {
          padding: 0 !important;

          .svg-icon {
            margin-left: 20px;
          }

          .el-submenu__icon-arrow {
            display: none;
          }
        }
      }
    }

    .el-menu--collapse {
      .el-submenu {
        &>.el-submenu__title {
          &>span {
            height: 0;
            width: 0;
            overflow: hidden;
            visibility: hidden;
            display: inline-block;
          }
        }
      }
    }

    .title-container {
      width: 54px;
      .title {
        display: none;
      }
    }

    .bottom-logo {
      .titles {
        display: none;
      }
    }
  }

  .el-menu--collapse .el-menu .el-submenu {
    min-width: $sideBarWidth !important;
  }

  // mobile responsive
  .mobile {
    .main-container {
      margin-left: 0;
    }

    .topNavTags{
      width: 100%;
    }

    .layout-footer {
      width: 100%;
    }

    .sidebar-container {
      transition: transform .28s;
      width: $sideBarWidth !important;
      position: absolute;
      left: 0;
      height: calc(100vh - 50px);
    }

    &.hideSidebar {
      .sidebar-container {
        pointer-events: none;
        transition-duration: 0.3s;
        transform: translate3d(-$sideBarWidth, 0, 0);
      }
    }
  }

  .withoutAnimation {

    .main-container,
    .sidebar-container {
      transition: none;
    }
  }
}

// when menu collapsed
.el-menu--vertical {
  &>.el-menu {
    @include bg-color(menuBg);
    @include text-color(menuText);
    .svg-icon {
      margin-right: 5px;
      fill: currentColor;
      font-size: 16px;
      vertical-align: middle;
    }
  }

  .nest-menu .el-submenu>.el-submenu__title,
  .el-menu-item {
    @include text-color(menuText);

    &.is-active {
      @include text-color(activeText);
    }

    &:hover {
      // you can use $subMenuHover
      // background-color: $menuHover !important;
      @include bg-color(menuHover);
    }
  }

  // the scroll bar appears when the subMenu is too long
  >.el-menu--popup {
    max-height: 100vh;
    overflow-y: auto;

    &::-webkit-scrollbar-track-piece {
      background: #d3dce6;
    }

    &::-webkit-scrollbar {
      width: 6px;
    }

    &::-webkit-scrollbar-thumb {
      background: #99a9bf;
      border-radius: 20px;
    }
  }
}
